package com.example.service;

import com.example.common.Result;
import com.example.entity.Article;
import com.example.mapper.ArticleMapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ArticleService {
    @Resource
    ArticleMapper articleMapper;
    public PageInfo<Article> seleContent(Integer pageNuma,Integer pageSize,Article article) {
        PageHelper.startPage(pageNuma,pageSize);
        List<Article> articleList = articleMapper.seleContent(article);
        return PageInfo.of(articleList);
    }

    public void add(Article article) {
        articleMapper.add(article);
    }

    public void deleteByid(Integer id) {
        articleMapper.deleteById(id);
    }

    public void update(Article article) {
        articleMapper.update(article);
    }
}
